if (navigator.serviceWorker) {
	fetch(G.root + '/sw').then(function(res) {

		if (res.ok) {
			return res.json();
		}

		throw res.statusText;
	}).then(function(resData) {
		if (resData.data.on) {
			navigator.serviceWorker.register(__uri('/integralmall/sw.js'));
		} else {
			navigator.serviceWorker.getRegistrations().then(function(registrations) {
				// console.log(registrations.scope)
				registrations.forEach(function(registration) {
					registration.unregister();
				});
			});
		}
	});
}